# mysql-ssh
FROM mysql:5.6
MAINTAINER fenglitan "fenglitan@icloud.com"　

# Install packages
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install openssh-server pwgen supervisor vim

RUN mkdir -p /var/run/sshd && sed -i "s/UsePrivilegeSeparation.*/UsePrivilegeSeparation no/g" /etc/ssh/sshd_config && sed -i "s/UsePAM.*/UsePAM no/g" /etc/ssh/sshd_config && sed -i "s/PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config

RUN chmod +x /*.sh

RUN /bin/echo 'root:123456'|chpasswd

RUN mkdir -p /var/log/supervisor
ADD supervisord.conf /etc/supervisord.conf

EXPOSE 22 3306

#RUN /usr/sbin/sshd
#RUN /usr/sbin/sshd -D

CMD ["/usr/bin/supervisord"]
#CMD ["/entrypoint.sh","mysqld", "--datadir=/var/lib/mysql", "--user=mysql"]